﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace CodeStash.Common.Helpers
{
    public static class Guard
    {
        [DebuggerHidden]
        public static void AssertNotNull<T>(T arg, string argName) where T : class
        {
            if (arg == null)
            {
                throw new ArgumentNullException(argName);
            }
        }



        [DebuggerHidden]
        public static void AssertStringNotNull(string arg, string argName) 
        {
            if (String.IsNullOrEmpty(arg))
            {
                throw new ArgumentNullException(argName);
            }
        }

        [DebuggerHidden]
        public static void AssertGreaterOrEqual(int arg, int limit, string argName)
        {
            if (arg < limit)
            {
                throw new ArgumentException(argName);
            }
        }

    }
}
